package com.x;

import com.x.dao.BookDao;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * ClassName: App
 * Package: IntelliJ IDEA
 * Description:
 * Written by HanXu
 * Create 2024.08.31 16:22
 */
public class App {
    public static void main(String[] args) {

        /**
         * Spring Ioc容器的实现类
         * 接口 BeanFactory
         * 子接口 Application
         * xml方式实现类: ClassPathXmlApplicationContext
         * Web项目的实现类: WebApplicationContext
         * 读取配置类的实现类: AnnotationApplicable
         */

        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        BookDao bookDao = (BookDao) context.getBean("bookDao");

        bookDao.save();

    }
}
